PROGS = server client
CFLAGS  = -Wall -g

CC:=gcc

LIBS += -pthread
LIBS += -lrt
LIBS += -L/mnt/f/mylibs/libevent/libs -l event
LIBS += -L/mnt/f/mylibs/libevent/libs -l event_core
LIBS += -L/mnt/f/mylibs/libevent/libs -l event_extra
LIBS += -L/mnt/f/mylibs/libevent/libs -l event_pthreads
INC := -I ./
INC +=-I ./inc
INC +=-I /mnt/f/mylibs/libevent/include/

depends_c = $(wildcard  ./src/*.c)				#找到所有的.c文件
depends_o = $(wildcard  ./*.o)				    #找到所有的.o文件
depends_h = $(wildcard  ./inc/*.h)				#找到所有的.h文件

all: clean ${PROGS}

server:${depends_c} server.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}

client:${depends_c} client.c
	${CC} ${CFLAGS} -o $@ $^ ${INC} ${LIBS}

line:
	cat *.c ./src/*.c ./inc/*.h |wc -l

clean:
	rm -f $(all_objs) $(o_objs) $(PROGS) *.out *.log